var tale = new $.tale();

/**
 * 保存文件信息
 * @param status
 */
function saveInfo() {
    if ($('#global-form #id').val() == ''){
        tale.alertWarn('文件id为空');
        return;
    }

    var params = $("#global-form").serialize();
    var url = getContextPath() + '/admin/upload/modify';
    tale.post({
        url:url,
        data:params,
        success: function (result) {
            if (result && result.success) {
                tale.alertOk({
                    text:'保存成功',
                    then: function () {
                        setTimeout(function () {
                            window.location.href = getContextPath() + '/admin/upload/list';
                        }, 500);
                    }
                });
            } else {
                tale.alertError(result.msg || '保存失败');
            }
        }
    });
}

